package com.gopay.common.domain.cps.vo;

import com.gopay.common.domain.cps.CpsGenMainOrder;
import com.gopay.common.domain.fund.FundGopayCpsGenOrder;
import com.gopay.common.util.DateUtils;

import java.util.Date;

/**
 * 
 * 基金类订单
 * 
 * 现在订单分父子表，应为父子表必须同时完成动作，所以放在Manager中进行事务实现
 * 
 */
public class FullCpsGenFundOrder extends CpsGenOrder{

    private static final long serialVersionUID = -5672665662560804481L;

    //子表属性
    private String agentSignNo;
    private Integer transDtlSeq;
    private String fundNo;
    private String merchantId;
    private String merOrderNum;
    private String tranType;
    private String fundOrderType;
    private String origMerOrderNum;
    private String respCode;
    private String verifyCode;
    private String cardNo;
    private String bankCode;
    private Date stlmDate;
    private String backgroundMerUrl;
    private String merRemark1;
    private String merRemark2;
    private String tranIp;
    private String dataSource;
    private String source;
    private String memo;
    private Date merTxnTm;

    private  String bizType;//业务类型



    public FullCpsGenFundOrder() {

    }

    public FullCpsGenFundOrder(CpsGenMainOrder main, FundGopayCpsGenOrder fundOrder) {
        setGopayOrderId(main.getGopayOrderId());
        setTransDtlSq(main.getTransDtlSq());
        setGopayIntTxnCd(main.getGopayIntTxnCd());
        setMerId(main.getMerId());
        setMerOrderId(main.getMerOrderId());
        setMerTxnTm(main.getMerTxnTm());
        setGatewaySource(main.getGatewaySource());
        setGatewayChannel(main.getGatewayChannel());
        setOrderType(main.getOrderType());
        setPayChannel(main.getPayChannel());
        setGopayTxnTm(main.getGopayTxnTm());
        setRelevanceGopayOrderId(main.getRelevanceGopayOrderId());
        setTotalOrderAmt(main.getTotalOrderAmt());
        setTotalOrderFeeAmt(main.getTotalOrderFeeAmt());
        setOrderDealAmt(main.getOrderDealAmt());
        setOrderRealFeeAmt(main.getOrderRealFeeAmt());
        setOrderFeePayer(main.getOrderFeePayer());
        setCurType(main.getCurType());
        setMainRecvAcct(main.getMainRecvAcct());
        setMainRecvAcctProdCode(main.getMainRecvAcctProdCode());
        setMainRecvAcctProdName(main.getMainRecvAcctProdName());
        setMainRecvCustId(main.getMainRecvCustId());
        setPayAcct(main.getPayAcct());
        setMainPayAcctProdCode(main.getMainPayAcctProdCode());
        setMainPayAcctProdName(main.getMainPayAcctProdName());
        setPayCustId(main.getPayCustId());
        setTxnStaCd(main.getTxnStaCd());
        setOutStlmId(main.getOutStlmId());
        setOutPayAcct(main.getOutPayAcct());
        setTranFinishTime(main.getTranFinishTime());
        setOrderStlmTime(main.getOrderStlmTime());
        setLastUpdTrancode(main.getLastUpdTrancode());
        setRemark1(main.getRemark1());
        setRemark2(main.getRemark2());
        setMerTxnAmt(main.getMerTxnAmt());
        setReversalFlag(main.getReversalFlag());

        setAccountPoint(main.getAccountPoint());

        setSettleAmt(main.getSettleAmt());//结算金额
        setOtherAcct(main.getOtherAcct());
        //fundOrder必须非空校验
        if(fundOrder!=null){
             agentSignNo =fundOrder.getAgentSignNo();
             transDtlSeq = fundOrder.getTransDtlSeq();
             fundNo = fundOrder.getFundNo();
             merchantId = fundOrder.getMerchantId();
             merOrderNum = fundOrder.getMerOrderNum();
             tranType = fundOrder.getTranType();
             fundOrderType = fundOrder.getOrderType();
             origMerOrderNum = fundOrder.getOrigMerOrderNum();
             respCode = fundOrder.getRespCode();
             verifyCode = fundOrder.getVerifyCode();
             cardNo = fundOrder.getCardNo();
             bankCode = fundOrder.getBankCode();
             stlmDate = fundOrder.getStlmDate();
             backgroundMerUrl =fundOrder.getBackgroundMerUrl();
             merRemark1 = fundOrder.getMerRemark1();
             merRemark2 = fundOrder.getMerRemark2();
             tranIp = fundOrder.getTranIp();
             dataSource = fundOrder.getDataSource();
             source = fundOrder.getSource();
             memo = fundOrder.getMemo();
             merTxnTm = fundOrder.getMerTxnTm();
             bizType = fundOrder.getBizType();
        }
    }
    
    public CpsGenMainOrder getCpsGenMainOrder() {
        CpsGenMainOrder main = new CpsGenMainOrder();
        main.setGopayOrderId(getGopayOrderId());
        main.setTransDtlSq(getTransDtlSq());
        main.setGopayIntTxnCd(getGopayIntTxnCd());
        main.setMerId(getMerId());
        main.setMerOrderId(getMerOrderId());
        main.setMerTxnTm(getMerTxnTm());
        main.setGatewaySource(getGatewaySource());
        main.setGatewayChannel(getGatewayChannel());
        main.setOrderType(getOrderType());
        main.setPayChannel(getPayChannel());
        main.setGopayTxnTm(getGopayTxnTm());
        main.setRelevanceGopayOrderId(getRelevanceGopayOrderId());
        main.setTotalOrderAmt(getTotalOrderAmt());
        main.setTotalOrderFeeAmt(getTotalOrderFeeAmt());
        main.setOrderDealAmt(getOrderDealAmt());
        main.setOrderRealFeeAmt(getOrderRealFeeAmt());
        main.setOrderFeePayer(getOrderFeePayer());
        main.setCurType(getCurType());
        main.setMainRecvAcct(getMainRecvAcct());
        main.setMainRecvAcctProdCode(getMainRecvAcctProdCode());
        main.setMainRecvAcctProdName(getMainRecvAcctProdName());
        main.setMainRecvCustId(getMainRecvCustId());
        main.setPayAcct(getPayAcct());
        main.setMainPayAcctProdCode(getMainPayAcctProdCode());
        main.setMainPayAcctProdName(getMainPayAcctProdName());
        main.setPayCustId(getPayCustId());
        main.setTxnStaCd(getTxnStaCd());
        main.setOutStlmId(getOutStlmId());
        main.setOutPayAcct(getOutPayAcct());
        main.setTranFinishTime(getTranFinishTime());
        main.setOrderStlmTime(getOrderStlmTime());
        main.setCreatedTs(DateUtils.getSystemDate());
        main.setLastUpdTs(DateUtils.getSystemDate());
        main.setLastUpdTrancode(getLastUpdTrancode());
        main.setRemark1(getRemark1());
        main.setRemark2(getRemark2());
        main.setMerTxnAmt(getMerTxnAmt());
        main.setAccountPoint(getAccountPoint());
        main.setReversalFlag(getReversalFlag());
        main.setSettleAmt(getSettleAmt());//结算金额
        main.setOtherAcct(getOtherAcct());
        return main;
    }
    
    public FundGopayCpsGenOrder getFundGopayCpsGenOrder() {
        FundGopayCpsGenOrder fundOrder = new FundGopayCpsGenOrder();
        fundOrder.setGopayOrderId(getGopayOrderId());
        fundOrder.setAgentSignNo(getAgentSignNo());
        fundOrder.setTransDtlSeq (getTransDtlSeq());
        fundOrder.setFundNo(getFundNo());
        fundOrder.setGopayIntTxnCd(getGopayIntTxnCd());
        fundOrder.setMerchantId(getMerchantId());
        fundOrder.setMerOrderNum(getMerOrderNum());
        fundOrder.setTranType(getTranType());
        fundOrder.setOrderType(getFundOrderType());
        fundOrder.setTotalOrderAmt(getTotalOrderAmt());
        fundOrder.setTotalOrderFeeAmt(getTotalOrderFeeAmt());
        fundOrder.setOrderDealAmt(getOrderDealAmt());
        fundOrder.setOrderRealFeeAmt(getOrderRealFeeAmt());
        fundOrder.setTranFinishTime(getTranFinishTime());
        fundOrder.setOrigMerOrderNum(getOrigMerOrderNum());
        fundOrder.setRespCode(getRespCode());
        fundOrder.setVerifyCode(getVerifyCode());
        fundOrder.setCardNo(getCardNo());
        fundOrder.setBankCode(getBankCode());
        fundOrder.setStlmDate(getStlmDate());
        fundOrder.setBackgroundMerUrl(getBackgroundMerUrl());
        fundOrder.setMerRemark1(getMerRemark1());
        fundOrder.setMerRemark2(getMerRemark2());
        fundOrder.setTranIp(getTranIp());
        fundOrder.setDataSource(getDataSource());
        fundOrder.setSource(getSource());
        fundOrder.setMemo(getMemo());
        fundOrder.setCreatedTs(getMainCreatedTs());
        fundOrder.setLastUpdTs(getMainLastUpdTs());
        fundOrder.setMerTxnTm(getMerTxnTm());
        fundOrder.setBizType(getBizType());
        fundOrder.setMerTxnAmt(getMerTxnAmt());
        return fundOrder;
    }

    public String getAgentSignNo() {
        return agentSignNo;
    }

    public void setAgentSignNo(String agentSignNo) {
        this.agentSignNo = agentSignNo;
    }

    public Integer getTransDtlSeq() {
        return transDtlSeq;
    }

    public void setTransDtlSeq(Integer transDtlSeq) {
        this.transDtlSeq = transDtlSeq;
    }

    public String getFundNo() {
        return fundNo;
    }

    public void setFundNo(String fundNo) {
        this.fundNo = fundNo;
    }

    public String getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(String merchantId) {
        this.merchantId = merchantId;
    }

    public String getMerOrderNum() {
        return merOrderNum;
    }

    public void setMerOrderNum(String merOrderNum) {
        this.merOrderNum = merOrderNum;
    }

    public String getTranType() {
        return tranType;
    }

    public void setTranType(String tranType) {
        this.tranType = tranType;
    }

    public String getFundOrderType() {
        return fundOrderType;
    }

    public void setFundOrderType(String fundOrderType) {
        this.fundOrderType = fundOrderType;
    }

    public String getOrigMerOrderNum() {
        return origMerOrderNum;
    }

    public void setOrigMerOrderNum(String origMerOrderNum) {
        this.origMerOrderNum = origMerOrderNum;
    }

    public String getRespCode() {
        return respCode;
    }

    public void setRespCode(String respCode) {
        this.respCode = respCode;
    }

    public String getVerifyCode() {
        return verifyCode;
    }

    public void setVerifyCode(String verifyCode) {
        this.verifyCode = verifyCode;
    }

    public String getCardNo() {
        return cardNo;
    }

    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }

    public String getBankCode() {
        return bankCode;
    }

    public void setBankCode(String bankCode) {
        this.bankCode = bankCode;
    }

    public Date getStlmDate() {
        return stlmDate;
    }

    public void setStlmDate(Date stlmDate) {
        this.stlmDate = stlmDate;
    }

    public String getBackgroundMerUrl() {
        return backgroundMerUrl;
    }

    public void setBackgroundMerUrl(String backgroundMerUrl) {
        this.backgroundMerUrl = backgroundMerUrl;
    }

    public String getMerRemark1() {
        return merRemark1;
    }

    public void setMerRemark1(String merRemark1) {
        this.merRemark1 = merRemark1;
    }

    public String getMerRemark2() {
        return merRemark2;
    }

    public void setMerRemark2(String merRemark2) {
        this.merRemark2 = merRemark2;
    }

    public String getTranIp() {
        return tranIp;
    }

    public void setTranIp(String tranIp) {
        this.tranIp = tranIp;
    }

    public String getDataSource() {
        return dataSource;
    }

    public void setDataSource(String dataSource) {
        this.dataSource = dataSource;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    @Override
    public Date getMerTxnTm() {
        return merTxnTm;
    }

    @Override
    public void setMerTxnTm(Date merTxnTm) {
        this.merTxnTm = merTxnTm;
    }

    public String getBizType() {
        return bizType;
    }

    public void setBizType(String bizType) {
        this.bizType = bizType;
    }
}
